#ifndef DECODE_PPC_H
#define DECODE_PPC_H

#include <inttypes.h>
#include <stddef.h>
#include <stdbool.h>

// Procedure for adding a new instruction:
// 	* Add its enum to the InstructionId in this file (decode.h)
// 	* Add logic to convert instruction bits to the new instruction in decode.c
// 	* Add its mnemonic in `GetMnemonic` in `mnemonic.c`
// 	* Add its operands in `FillOperands` in `operands.c`
//
// This only handles instruction decoding (going from bits --> a powerpc
// instruction), and not anything like lifting or the behavior of the
// instruction itself.

#define DECODE_FLAGS_PPC64              0x01
#define DECODE_FLAGS_ALTIVEC            0x02
#define DECODE_FLAGS_VSX                0x04
#define DECODE_FLAGS_QPX                0x08
#define DECODE_FLAGS_PS                 0x10
#define DECODE_FLAGS_SPE                0x20
#define DECODE_FLAGS_VLE                0x40
// When set, disassembly translates to a "normal" PowerPC instruction, which
// usually amounts to simply dropping the "e_"/"se_" prefix and adding an extra
// register (changing rX, rY --> rD, rA, rB) , but sometimes totally change the
// instruction (for example, replacing `se_bgeni` with `li`)
//
// Should always be set in `flags` for LLIL, to maximize code reuse
#define DECODE_FLAGS_VLE_TRANSLATE      0x80

#ifdef __cplusplus
extern "C" {
#endif
	enum Register
	{

		PPC_REG_INVALID = 0,

		PPC_REG_CARRY = 2,
		PPC_REG_CTR = 3,
		PPC_REG_LR = 5,
		PPC_REG_RM = 6,
		PPC_REG_VRSAVE = 8,
		PPC_REG_XER = 9,
		PPC_REG_ZERO = 10,
		PPC_REG_CTR8 = 20,

		PPC_REG_GPR0 = 87,
		PPC_REG_GPR1,
		PPC_REG_GPR2,
		PPC_REG_GPR3,
		PPC_REG_GPR4,
		PPC_REG_GPR5,
		PPC_REG_GPR6,
		PPC_REG_GPR7,
		PPC_REG_GPR8,
		PPC_REG_GPR9,
		PPC_REG_GPR10,
		PPC_REG_GPR11,
		PPC_REG_GPR12,
		PPC_REG_GPR13,
		PPC_REG_GPR14,
		PPC_REG_GPR15,
		PPC_REG_GPR16,
		PPC_REG_GPR17,
		PPC_REG_GPR18,
		PPC_REG_GPR19,
		PPC_REG_GPR20,
		PPC_REG_GPR21,
		PPC_REG_GPR22,
		PPC_REG_GPR23,
		PPC_REG_GPR24,
		PPC_REG_GPR25,
		PPC_REG_GPR26,
		PPC_REG_GPR27,
		PPC_REG_GPR28,
		PPC_REG_GPR29,
		PPC_REG_GPR30,
		PPC_REG_GPR31,

		PPC_REG_FR0 = 21,
		PPC_REG_FR1,
		PPC_REG_FR2,
		PPC_REG_FR3,
		PPC_REG_FR4,
		PPC_REG_FR5,
		PPC_REG_FR6,
		PPC_REG_FR7,
		PPC_REG_FR8,
		PPC_REG_FR9,
		PPC_REG_FR10,
		PPC_REG_FR11,
		PPC_REG_FR12,
		PPC_REG_FR13,
		PPC_REG_FR14,
		PPC_REG_FR15,
		PPC_REG_FR16,
		PPC_REG_FR17,
		PPC_REG_FR18,
		PPC_REG_FR19,
		PPC_REG_FR20,
		PPC_REG_FR21,
		PPC_REG_FR22,
		PPC_REG_FR23,
		PPC_REG_FR24,
		PPC_REG_FR25,
		PPC_REG_FR26,
		PPC_REG_FR27,
		PPC_REG_FR28,
		PPC_REG_FR29,
		PPC_REG_FR30,
		PPC_REG_FR31,

		// each 4-bit CR register
		PPC_REG_CRF0 = 12,
		PPC_REG_CRF1,
		PPC_REG_CRF2,
		PPC_REG_CRF3,
		PPC_REG_CRF4,
		PPC_REG_CRF5,
		PPC_REG_CRF6,
		PPC_REG_CRF7,

		PPC_REG_AV_VR0 = 121,
		PPC_REG_AV_VR1,
		PPC_REG_AV_VR2,
		PPC_REG_AV_VR3,
		PPC_REG_AV_VR4,
		PPC_REG_AV_VR5,
		PPC_REG_AV_VR6,
		PPC_REG_AV_VR7,
		PPC_REG_AV_VR8,
		PPC_REG_AV_VR9,
		PPC_REG_AV_VR10,
		PPC_REG_AV_VR11,
		PPC_REG_AV_VR12,
		PPC_REG_AV_VR13,
		PPC_REG_AV_VR14,
		PPC_REG_AV_VR15,
		PPC_REG_AV_VR16,
		PPC_REG_AV_VR17,
		PPC_REG_AV_VR18,
		PPC_REG_AV_VR19,
		PPC_REG_AV_VR20,
		PPC_REG_AV_VR21,
		PPC_REG_AV_VR22,
		PPC_REG_AV_VR23,
		PPC_REG_AV_VR24,
		PPC_REG_AV_VR25,
		PPC_REG_AV_VR26,
		PPC_REG_AV_VR27,
		PPC_REG_AV_VR28,
		PPC_REG_AV_VR29,
		PPC_REG_AV_VR30,
		PPC_REG_AV_VR31,

		PPC_REG_VSX_VR0 = 215,
		PPC_REG_VSX_VR1,
		PPC_REG_VSX_VR2,
		PPC_REG_VSX_VR3,
		PPC_REG_VSX_VR4,
		PPC_REG_VSX_VR5,
		PPC_REG_VSX_VR6,
		PPC_REG_VSX_VR7,
		PPC_REG_VSX_VR8,
		PPC_REG_VSX_VR9,
		PPC_REG_VSX_VR10,
		PPC_REG_VSX_VR11,
		PPC_REG_VSX_VR12,
		PPC_REG_VSX_VR13,
		PPC_REG_VSX_VR14,
		PPC_REG_VSX_VR15,
		PPC_REG_VSX_VR16,
		PPC_REG_VSX_VR17,
		PPC_REG_VSX_VR18,
		PPC_REG_VSX_VR19,
		PPC_REG_VSX_VR20,
		PPC_REG_VSX_VR21,
		PPC_REG_VSX_VR22,
		PPC_REG_VSX_VR23,
		PPC_REG_VSX_VR24,
		PPC_REG_VSX_VR25,
		PPC_REG_VSX_VR26,
		PPC_REG_VSX_VR27,
		PPC_REG_VSX_VR28,
		PPC_REG_VSX_VR29,
		PPC_REG_VSX_VR30,
		PPC_REG_VSX_VR31,
		PPC_REG_VSX_VR32,
		PPC_REG_VSX_VR33,
		PPC_REG_VSX_VR34,
		PPC_REG_VSX_VR35,
		PPC_REG_VSX_VR36,
		PPC_REG_VSX_VR37,
		PPC_REG_VSX_VR38,
		PPC_REG_VSX_VR39,
		PPC_REG_VSX_VR40,
		PPC_REG_VSX_VR41,
		PPC_REG_VSX_VR42,
		PPC_REG_VSX_VR43,
		PPC_REG_VSX_VR44,
		PPC_REG_VSX_VR45,
		PPC_REG_VSX_VR46,
		PPC_REG_VSX_VR47,
		PPC_REG_VSX_VR48,
		PPC_REG_VSX_VR49,
		PPC_REG_VSX_VR50,
		PPC_REG_VSX_VR51,
		PPC_REG_VSX_VR52,
		PPC_REG_VSX_VR53,
		PPC_REG_VSX_VR54,
		PPC_REG_VSX_VR55,
		PPC_REG_VSX_VR56,
		PPC_REG_VSX_VR57,
		PPC_REG_VSX_VR58,
		PPC_REG_VSX_VR59,
		PPC_REG_VSX_VR60,
		PPC_REG_VSX_VR61,
		PPC_REG_VSX_VR62,
		PPC_REG_VSX_VR63,

		PPC_REG_GQR0 = 345,
		PPC_REG_GQR1,
		PPC_REG_GQR2,
		PPC_REG_GQR3,
		PPC_REG_GQR4,
		PPC_REG_GQR5,
		PPC_REG_GQR6,
		PPC_REG_GQR7,
	};

#ifndef __cplusplus
	typedef enum Register Register;
#endif

	enum OperandClass
	{
		PPC_OP_NONE = 0,
		PPC_OP_UIMM,
		PPC_OP_SIMM,
		PPC_OP_LABEL,
		PPC_OP_MEM_RA,

		PPC_OP_REG_RA,
		PPC_OP_REG_RB,
		PPC_OP_REG_RC,
		PPC_OP_REG_RD,
		PPC_OP_REG_RS,

		PPC_OP_REG_FRA,
		PPC_OP_REG_FRB,
		PPC_OP_REG_FRC,
		PPC_OP_REG_FRD,
		PPC_OP_REG_FRS,

		PPC_OP_REG_CRFD,
		PPC_OP_REG_CRFD_IMPLY0,
		PPC_OP_REG_CRFS,
		PPC_OP_REG_CRFS_IMPLY0,
		PPC_OP_CRBIT,
		PPC_OP_CRBIT_A,
		PPC_OP_CRBIT_B,
		PPC_OP_CRBIT_D,

		PPC_OP_REG_AV_VA,
		PPC_OP_REG_AV_VB,
		PPC_OP_REG_AV_VC,
		PPC_OP_REG_AV_VD,
		PPC_OP_REG_AV_VS,

		// DWORD0 means that only the 0th dword is affected, which
		// has an overlap with floating registers
		PPC_OP_REG_VSX_RA,
		PPC_OP_REG_VSX_RA_DWORD0,

		PPC_OP_REG_VSX_RB,
		PPC_OP_REG_VSX_RB_DWORD0,

		PPC_OP_REG_VSX_RC,
		PPC_OP_REG_VSX_RC_DWORD0,

		PPC_OP_REG_VSX_RD,
		PPC_OP_REG_VSX_RD_DWORD0,

		PPC_OP_REG_VSX_RS,
		PPC_OP_REG_VSX_RS_DWORD0,
	};

#ifndef __cplusplus
	typedef enum OperandClass OperandClass;
#endif

	enum VsxWidth
	{
		VSX_WIDTH_FULL,
		VSX_WIDTH_DWORD0,
	};

#ifndef __cplusplus
	typedef enum VsxWidth VsxWidth;
#endif

	struct MemoryOperand
	{
		enum Register reg;
		int32_t offset;
	};

#ifndef __cplusplus
	typedef struct MemoryOperand MemoryOperand;
#endif

	struct Operand
	{
		OperandClass cls;
		union {
			enum Register reg;
			uint64_t uimm;
			int64_t simm;
			MemoryOperand mem;
			uint64_t label;
			uint32_t crbit;
		};
	};

#ifndef __cplusplus
	typedef struct Operand Operand;
#endif

	struct OperandsList
	{
		size_t numOperands;
		Operand operands[8];
	};

#ifndef __cplusplus
	typedef struct OperandsList OperandsList;
#endif

	// trailing lowercase 'x' indicates potential other mnemonics (rc, oe, lk,
	// etc. bits)
	enum InstructionId
	{
		PPC_ID_INVALID,

		PPC_ID_ADDx,
		PPC_ID_ADDCx,
		PPC_ID_ADDEx,
		PPC_ID_ADDIx,
		PPC_ID_ADDICx,
		PPC_ID_ADDIS,
		PPC_ID_ADDMEx,
		PPC_ID_ADDPCIS,
		PPC_ID_ADDZEx,
		PPC_ID_ANDx,
		PPC_ID_ANDCx,
		PPC_ID_ANDIx,
		PPC_ID_ANDIS,
		PPC_ID_ATTN,
		PPC_ID_Bx,
		PPC_ID_BCx,
		PPC_ID_BCCTRx,
		PPC_ID_BCLRx,
		PPC_ID_BPERMD,
		PPC_ID_CLRBHRB,
		PPC_ID_CLRLDIx,
		PPC_ID_CLRRDIx,
		PPC_ID_CLRLWIx,
		PPC_ID_CLRRWIx,
		PPC_ID_CMPB,
		PPC_ID_CMPD,
		PPC_ID_CMPDI,
		PPC_ID_CMPEQB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STDUX,
		PPC_ID_STDX,
		PPC_ID_STFD,
		PPC_ID_STFDEPX,
		PPC_ID_STFDU,
		PPC_ID_STFDUX,
		PPC_ID_STFDX,
		PPC_ID_STFIWX,
		PPC_ID_STFS,
		PPC_ID_STFSU,
		PPC_ID_STFSUX,
		PPC_ID_STFSX,
		PPC_ID_STH,
		PPC_ID_STHBRX,
		PPC_ID_STHCX,
		PPC_ID_STHCIX,
		PPC_ID_STHEPX,
		PPC_ID_STHU,
		PPC_ID_STHUX,
		PPC_ID_STHX,
		PPC_ID_STMW,
		PPC_ID_STOP,
		PPC_ID_STSWI,
		PPC_ID_STSWX,
		PPC_ID_STW,
		PPC_ID_STWAT,
		PPC_ID_STWBRX,
		PPC_ID_STWCIX,
		PPC_ID_STWCX,
		PPC_ID_STWEPX,
		PPC_ID_STWU,
		PPC_ID_STWUX,
		PPC_ID_STWX,
		PPC_ID_SUBFx,
		PPC_ID_SUBFCx,
		PPC_ID_SUBFEx,
		PPC_ID_SUBFICx,
		PPC_ID_SUBFMEx,
		PPC_ID_SUBFZEx,
		PPC_ID_SYNC,
		PPC_ID_TABORT,
		PPC_ID_TABORTDC,
		PPC_ID_TABORTDCI,
		PPC_ID_TABORTWC,
		PPC_ID_TABORTWCI,
		PPC_ID_TBEGIN,
		PPC_ID_TCHECK,
		PPC_ID_TD,
		PPC_ID_TDEQ,
		PPC_ID_TDEQI,
		PPC_ID_TDGT,
		PPC_ID_TDGTI,
		PPC_ID_TDI,
		PPC_ID_TDLGT,
		PPC_ID_TDLGTI,
		PPC_ID_TDLLT,
		PPC_ID_TDLLTI,
		PPC_ID_TDLT,
		PPC_ID_TDLTI,
		PPC_ID_TDNE,
		PPC_ID_TDNEI,
		PPC_ID_TDU,
		PPC_ID_TDUI,
		PPC_ID_TEND,
		PPC_ID_TLBIA,
		PPC_ID_TLBIE,
		PPC_ID_TLBIEL,
		PPC_ID_TLBIVAX,
		PPC_ID_TLBLI,
		PPC_ID_TLBSX,
		PPC_ID_TLBSY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1,
		PPC_ID_PAIREDSINGLE_PS_DIVx,
		PPC_ID_PAIREDSINGLE_PS_MADDx,
		PPC_ID_PAIREDSINGLE_PS_MADDS0x,
		PPC_ID_PAIREDSINGLE_PS_MADDS1x,
		PPC_ID_PAIREDSINGLE_PS_MERGE00x,
		PPC_ID_PAIREDSINGLE_PS_MERGE01x,
		PPC_ID_PAIREDSINGLE_PS_MERGE10x,
		PPC_ID_PAIREDSINGLE_PS_MERGE11x,
		PPC_ID_PAIREDSINGLE_PS_MRx,
		PPC_ID_PAIREDSINGLE_PS_MSUBx,
		PPC_ID_PAIREDSINGLE_PS_MULx,
		PPC_ID_PAIREDSINGLE_PS_MULS0x,
		PPC_ID_PAIREDSINGLE_PS_MULS1x,
		PPC_ID_PAIREDSINGLE_PS_NABSx,
		PPC_ID_PAIREDSINGLE_PS_NEGx,
		PPC_ID_PAIREDSINGLE_PS_NMADDx,
		PPC_ID_PAIREDSINGLE_PS_NMSUBx,
		PPC_ID_PAIREDSINGLE_PS_RESx,
		PPC_ID_PAIREDSINGLE_PS_RSQRTEx,
		PPC_ID_PAIREDSINGLE_PS_SELx,
		PPC_ID_PAIREDSINGLE_PS_SUBx,
		PPC_ID_PAIREDSINGLE_PS_SUM0x,
		PPC_ID_PAIREDSINGLE_PS_SUM1x,
		PPC_ID_PAIREDSINGLE_PSQ_L,
		PPC_ID_PAIREDSINGLE_PSQ_LU,
		PPC_ID_PAIREDSINGLE_PSQ_LUX,
		PPC_ID_PAIREDSINGLE_PSQ_LX,
		PPC_ID_PAIREDSINGLE_PSQ_ST,
		PPC_ID_PAIREDSINGLE_PSQ_STU,
		PPC_ID_PAIREDSINGLE_PSQ_STUX,
		PPC_ID_PAIREDSINGLE_PSQ_STX,

		// SPE (Signal Processing Engine) instructions
		PPC_ID_SPE_BRINC,
		PPC_ID_SPE_EFDABS,
		PPC_ID_SPE_EFDADD,
		PPC_ID_SPE_EFDCFS,
		PPC_ID_SPE_EFDCFSF,
		PPC_ID_SPE_EFDC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PC_ID_SPE_EVSTDWX,
		PPC_ID_SPE_EVSTWHE,
		PPC_ID_SPE_EVSTWHEX,
		PPC_ID_SPE_EVSTWHO,
		PPC_ID_SPE_EVSTWHOX,
		PPC_ID_SPE_EVSTWWE,
		PPC_ID_SPE_EVSTWWEX,
		PPC_ID_SPE_EVSTWWO,
		PPC_ID_SPE_EVSTWWOX,
		PPC_ID_SPE_EVSUBFSMIAAW,
		PPC_ID_SPE_EVSUBFSSIAAW,
		PPC_ID_SPE_EVSUBFUMIAAW,
		PPC_ID_SPE_EVSUBFUSIAAW,
		PPC_ID_SPE_EVSUBFW,
		PPC_ID_SPE_EVSUBIFW,
		PPC_ID_SPE_EVXOR,

		// This should be all of the VLE instructions; if any get added
		// here, make sure `vle32.c:IsVleInstructionId` remains valid
		//
		// 32-bit VLE instructions
		PPC_ID_VLE_E_ADDIx,
		PPC_ID_VLE_E_ADDICx,
		PPC_ID_VLE_E_ADD2I,
		PPC_ID_VLE_E_ADD2IS,
		PPC_ID_VLE_E_ADD16I,
		PPC_ID_VLE_E_ANDIx,
		PPC_ID_VLE_E_AND2I,
		PPC_ID_VLE_E_AND2IS,
		PPC_ID_VLE_E_Bx,
		PPC_ID_VLE_E_BCx,
		PPC_ID_VLE_E_CMP16I,
		PPC_ID_VLE_E_CMPH16I,
		PPC_ID_VLE_E_CMPHL,
		PPC_ID_VLE_E_CMPHL16I,
		PPC_ID_VLE_E_CMPI,
		PPC_ID_VLE_E_CMPL16I,
		PPC_ID_VLE_E_CMPLI,
		PPC_ID_VLE_E_CRAND,
		PPC_ID_VLE_E_CRANDC,
		PPC_ID_VLE_E_CREQV,
		PPC_ID_VLE_E_CRNAND,
		PPC_ID_VLE_E_CRNOR,
		PPC_ID_VLE_E_CROR,
		PPC_ID_VLE_E_CRORC,
		PPC_ID_VLE_E_CRXOR,
		PPC_ID_VLE_E_LBZ,
		PPC_ID_VLE_E_LBZU,
		PPC_ID_VLE_E_LHA,
		PPC_ID_VLE_E_LHAU,
		PPC_ID_VLE_E_LHZ,
		PPC_ID_VLE_E_LHZU,
		PPC_ID_VLE_E_LI,
		PPC_ID_VLE_E_LIS,
		PPC_ID_VLE_E_LMW,
		PPC_ID_VLE_E_LWZ,
		PPC_ID_VLE_E_LWZU,
		PPC_ID_VLE_E_MCRF,
		PPC_ID_VLE_E_MULL2I,
		PPC_ID_VLE_E_MULLI,
		PPC_ID_VLE_E_OR2I,
		PPC_ID_VLE_E_OR2IS,
		PPC_ID_VLE_E_ORIx,
		PPC_ID_VLE_E_RLWx,
		PPC_ID_VLE_E_RLWIx,
		PPC_ID_VLE_E_RLWIMI,
		PPC_ID_VLE_E_RLWINM,
		PPC_ID_VLE_E_SLWIx,
		PPC_ID_VLE_E_SRWIx,
		PPC_ID_VLE_E_STB,
		PPC_ID_VLE_E_STBU,
		PPC_ID_VLE_E_STH,
		PPC_ID_VLE_E_STHU,
		PPC_ID_VLE_E_STMW,
		PPC_ID_VLE_E_STW,
		PPC_ID_VLE_E_STWU,
		PPC_ID_VLE_E_SUBFICx,
		PPC_ID_VLE_E_XORIx,

		// Additional 32-bit VLE instructions from NXP EB696
		//
		// Note that chapter 3 "Instruction Operation Codes"
		// and table 4 "Instruction Overview" list these as "LDMxxxx",
		// but all of the mnemonics used in chapter 5 "Instruction
		// Listings" are "LDxxxx" (note the lack of M)...assembly
		// samples from an mpc5744 use the variant without the M, so we
		// use that.
		PPC_ID_VLE_E_LDVGPRW,
		PPC_ID_VLE_E_LDVSPRW,
		PPC_ID_VLE_E_LDVSRRW,
		PPC_ID_VLE_E_LDVCSRRW,
		PPC_ID_VLE_E_LDVDSRRW,
		PPC_ID_VLE_E_STMVGPRW,
		PPC_ID_VLE_E_STMVSPRW,
		PPC_ID_VLE_E_STMVSRRW,
		PPC_ID_VLE_E_STMVCSRRW,
		PPC_ID_VLE_E_STMVDSRRW,

		// 16-bit VLE instructions
		PPC_ID_VLE_SE_ADD,
		PPC_ID_VLE_SE_ADDI,
		PPC_ID_VLE_SE_ANDx,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_SRW,
		PPC_ID_VLE_SE_SRWI,
		PPC_ID_VLE_SE_STB,
		PPC_ID_VLE_SE_STH,
		PPC_ID_VLE_SE_STW,
		PPC_ID_VLE_SE_SUB,
		PPC_ID_VLE_SE_SUBF,
		PPC_ID_VLE_SE_SUBIx,
	};

#ifndef __cplusplus
	typedef enum InstructionId InstructionId;
#endif

	struct Instruction
	{
		// When decoding with VLE -> base PPC translation (ie
		// `decodeFlags & DECODE_FLAGS_VLE_TRANSLATE != 0), this ID may
		// not faithfully represent the exact bytes corresponding to this
		// instruction, but it will always represent something
		// semantically equivalent; for example, PPC_ID_VLE_SE_BGENI
		// may end up as a semantically equivalent PPC_ID_LI
		// instruction.
		//
		// When `decodeFlags & DECODE_FLAGS_VLE_TRANSLATE == 0`, this
		// ID always represents the bytes correspondong to the
		// instruction
		InstructionId id;

		// This always represents the number of bytes in the
		// underlying bytes of the instruction, regardless of whether
		// it was translated with `DECODE_FLAGS_VLE_TRANSLATE`.
		size_t numBytes;

		// These acronyms are from the documentation; sometimes they
		// refer to the same bit (like RC and LK)
		struct {
			uint32_t rc: 1;
			uint32_t oe: 1;
			uint32_t lk: 1;
			uint32_t aa: 1;
			uint32_t branchLikelyHint: 2;
			uint32_t round2odd: 1;
			uint32_t inexact: 1;
		} flags;

		size_t numOperands;
		Operand operands[8];
	};

#ifndef __cplusplus
	typedef struct Instruction Instruction;
#endif

	// returns 0 if data_length is too small to tell
	size_t GetInstructionLength(const uint8_t* data, size_t data_length, uint32_t flags);

	bool Decompose16(Instruction* instruction, uint16_t word32, uint64_t address, uint32_t flags);
	bool Decompose32(Instruction* instruction, uint32_t word32, uint64_t address, uint32_t flags);
	void FillBcxOperands(OperandsList* bcx, const Instruction* instruction);
	void FillBcctrxOperands(OperandsList* bcctrx, const Instruction* instruction);
	void FillBclrxOperands(OperandsList* bclrx, const Instruction* instruction);
	void FillVle16BcOperands(OperandsList *se_bc, const Instruction *instruction);
	void FillVle32BcxOperands(OperandsList *e_bcx, const Instruction *instruction);
	const char* GetMnemonic(const Instruction* instruction);
	const char* PowerPCRegisterName(uint32_t regId);
	const char* OperandClassName(uint32_t cls);
	const char* GetCRBitName(uint32_t crbit);

	size_t VleGetInstructionLength(const uint8_t* data, size_t data_length, uint32_t decodeFlags);
	bool Decompose16Vle(Instruction* instruction, uint16_t word16, uint64_t address, uint32_t flags);
	bool Decompose32Vle(Instruction* instruction, uint32_t word32, uint64_t address, uint32_t flags);

#ifdef __cplusplus
}
#endif


#endif // DECODE_PPC_H
